'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
    return queryInterface.sequelize.transaction(async t => {
      await queryInterface.bulkInsert("sys_user", [
        {
          user_id:1,
          dept_id:103,
          user_name:"admin",
          nick_name:"若依",
          user_type:"00",
          email:"ry@163.com",
          phonenumber:"15888888888",
          sex:"1",
          avatar:"",
          password:"123456",
          status:"0",
          login_ip:"127.0.0.1",
          create_by:"admin",
          update_by:"admin",
          remark:"管理员",
          login_date:new Date(),
          created_at:new Date(),
          updated_at:new Date()
        },{
          user_id:2,
          dept_id:105,
          user_name:"ry",
          nick_name:"若依",
          user_type:"00",
          email:"ry@qq.com",
          phonenumber:"15666666666",
          sex:"1",
          avatar:"",
          password:"123456",
          status:"0",
          login_ip:"127.0.0.1",
          create_by:"",
          update_by:"",
          remark:"测试员",
          login_date:new Date(),
          created_at:new Date(),
          updated_at:new Date()
        }
      ], { transaction: t });
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    return queryInterface.sequelize.transaction(async t => {
      return await queryInterface.bulkDelete("sys_user", null, { transaction: t });
    })
  }
};
